package com.seek.service.imp;

import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

import com.seek.core.BaseServiceImpl;
import com.seek.dao.InterLogDao;
import com.seek.model.entity.TInterLog;
import com.seek.service.InterLogService;

@Repository("interLogService")
public class InterLogServiceImpl extends BaseServiceImpl<TInterLog> implements InterLogService {

	@Autowired
	public void setDao(InterLogDao interLogDao) {
		super.setDao(interLogDao);
	}
	public InterLogDao getDao() {
		return (InterLogDao) super.getDao();
	}
	
	@SuppressWarnings("rawtypes")
	public List findBySql(String sql){
		return this.getDao().findBySql(sql);
	}
	
	public void executeUpdateSql(String sql) throws Exception{
		this.getDao().executeUpdateSql(sql);
	}

    public int executeUpdateSqlWithReturn(String sql) throws Exception{
        return this.getDao().executeUpdateSqlWithRetun(sql);
    }
    
    @SuppressWarnings("rawtypes")
	public List findMapBySql(String sql, Object... values){
    	return this.getDao().findMapBySql(sql, values);
    }
    
    @SuppressWarnings("unchecked")
	public Map<String,Object> findOneMapBySql(String sql, Object... values){
    	List<Map<String,Object>> ds = this.findMapBySql(sql, values);
    	if (ds == null || ds.size() < 1)
    		return null;
    	return ds.get(0);
    }
}